// @@
// @ Author       : Eacher
// @ Date         : 2023-03-02 15:31:08
// @ LastEditTime : 2023-03-11 15:13:26
// @ LastEditors  : Eacher
// @ --------------------------------------------------------------------------------<
// @ Description  : 
// @ --------------------------------------------------------------------------------<
// @ FilePath     : /parser/examples/main.go
// @@
package main

import (
	"fmt"
	// "bytes"
	"time"
	"github.com/20yyq/parser"
)

func main() {
	// p := parser.NewMaps([]byte(`{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"0":{"1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}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}`), true)
	p := parser.NewMaps([]byte(`{
	"id": "d50887ca-a6ce-4e59-b89f-14f0b5d03b03",
	"name": {
		"fullName": "Leonid Bugaev",
		"givenName": "Leonid",
		"familyName": "Bugaev"
	},
	"email": "leonsbo\\"x@gmail.com",
	"gender": "male",
	"location": "Saint Petersburg, Saint Petersburg, RU",
	"geo": {
		"city": "Saint Petersburg",
		"state": "Saint Petersburg",
		"country": "Russia",
		"lat": 59.9342802,
		"lng": 30.3350986
	},
	"bio": "Senior engineer at Granify.com",
	"site": "http://flickfaver.com",
	"avatar": "https://d1ts43dypk8bqh.cloudfront.net/v1/avatars/d50887ca-a6ce-4e59-b89f-14f0b5d03b03",
	"employment": {
		"name": "www.latera.ru",
		"title": "Software Engineer",
		"domain": "gmail.com"
	},
	"facebook": {
		"handle": "leonid.bugaev"
	},
	"github": {
		"handle": "buger",
		"id": 14009,
		"avatar": "https://avatars.githubusercontent.com/u/14009?v=3",
		"company": "Granify",
		"blog": "http://leonsbox.com",
		"followers": 95,
		"following": 10
	},
	"twitter": {
		"handle": "flickfaver",
		"id": 77004410,
		"bio": null,
		"followers": 2,
		"following": 1,
		"statuses": 5,
		"favorites": 0,
		"location": "",
		"site": "http://flickfaver.com",
		"avatar": null
	},
	"linkedin": {
		"handle": "in/leonidbugaev"
	},
	"googleplus": {
		"handle": null
	},
	"angellist": {
		"handle": "leonid-bugaev",
		"id": 61541,
		"bio": "Senior engineer at Granify.com",
		"blog": "http://buger.github.com",
		"site": "http://buger.github.com",
		"followers": 41,
		"avatar": "https://d1qb2nb5cznatu.cloudfront.net/users/61541-medium_jpg?1405474390"
	},
	"klout": {
		"handle": null,
		"score": null
	},
	"foursquare": {
		"handle": null
	},
	"aboutme": {
		"handle": "leonid.bugaev",
		"bio": null,
		"avatar": null
	},
	"followers": 2,
	"following": 1,
	"statuses": 5,
	"gravatar": {
		"handle": "buger",
		"urls": [],
		"avatar": "http://1.gravatar.com/avatar/f7c8edd577d13b8930d5522f28123510",
		"avatars": [{
			"url": "http://1.gravatar.com/avatar/f7c8edd577d13b8930d5522f28123510",
			"type": "thumbnail"
		}]
	},
	"fuzzy": true,
	"company": null,
	"favorites": 0
}`), parser.Config{})
	p.Load()
	v, ok := parser.Get[[]*parser.Item](p, "gravatar.avatars")
	v1, ok1 := parser.ItemValue[*parser.Node](v[0])
	v2, ok2 := parser.ItemValue[string](parser.FindItem(v1, "type"))
	fmt.Println("1451351", p, p.Load(), v, ok, v1, ok1, v2, ok2)
	v3, ok3 := parser.Get[uint64](p, "angellist.followers")
	fmt.Println("1451351", p, p.Load(), v3, ok3)
	time.Sleep(time.Second*1)
	parser.Set[string](p, "", "gravatar.avatars")
}
